package com.ml.service.impl;

import com.ml.dao.BaseDao;
import com.ml.model.KqDataException;
import com.ml.service.KqDataExceptionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional
@Service()
public class KqDataExceptionServiceImpl implements KqDataExceptionService {

    @Autowired
    private BaseDao<KqDataException> basedao;

    @Override
    public void save(KqDataException model) {
        basedao.save(model);
    }

    @Override
    public void update(KqDataException model) {
        basedao.update(model);
    }

    @Override
    public void delete(String id) {
        basedao.delete(getByID(id));
    }

    @Override
    public KqDataException getByID(String id) {
        return basedao.get(KqDataException.class,id);
    }

    public List<KqDataException> getByLocationid(String locationid){
        return  basedao.find(" from  KqDataException where locationid = ? ",new Object[]{locationid});
    }

}
